<?php
$userid = get_loggedin_userid();
$avatar_url = get_input('avatar_url');

$return = create_metadata($userid, 'metaUserIcon', $avatar_url, 'text', $userid, 2);

if($return) {
	echo json_encode(export_result(200, $avatar_url));
} else {
	echo json_encode(export_result(400, "Error on changing avatar. Try again."));
}

?>